package com.example.win.android_banduyujia.peopleactivity.ui.pullableview;

import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebView;

/**
 * Created by S3YOGA on 2015/10/13.
 */
public class PullableWebView extends WebView implements Pullable{

    public PullableWebView(Context context) {
        super(context);
    }

    public PullableWebView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public PullableWebView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean canPullDown() {
        if(getScaleY() == 0)
            return true;
        else
           return false;
    }

    @Override
    public boolean canPullUp() {
        if(getScaleY() >= getContentHeight() * getScale() - getMeasuredHeight())
            return true;
        else
            return false;
    }
}
